package com.hudsonmq.spring.config;

import com.hudsonmq.spring.HudsonMQClientController;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/8/17 2:26
 **/
@Configuration
@ComponentScan(value = "com.hudsonmq.spring")
public class HudsonMQAutoConfiguration {


    @Bean
    @ConditionalOnProperty(prefix = "hudson",name = "produce-group")
    public HudsonMQClientController hudsonMQProduceController() {
        return new HudsonMQClientController();
    }

    @Bean
    @ConditionalOnMissingBean
    public HudsonMQConfig hudsonMQConfig() {
        return new HudsonMQConfig();
    }
}
